﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.成品出库单.service;
using DXApplicationTangche.UC.盘点.Service;
using DXApplicationTangche.UC.货号管理;

namespace DXApplicationTangche.UC.盘点.盘点UC
{
    public partial class XtraUserControl盘点完成 : DevExpress.XtraEditors.XtraUserControl
    {
        //盘盈一览
        private List<StockInOutDetailDTO> stockInOutDetailDTOs = new List<StockInOutDetailDTO>();
        private String stockStoreInventoryPlanCode;//门店盘点计划号
        public XtraUserControl盘点完成()
        {
            InitializeComponent();
        }
        public XtraUserControl盘点完成(String stockStoreInventoryPlanCode)
        {
            InitializeComponent();
            this.stockStoreInventoryPlanCode = stockStoreInventoryPlanCode;
            this.refreshDate();
        }

        public void refreshDate()
        {
            //this.stockInOutDetailDTOs = 盘点Service.getStockInventorySurplusAll(this.stockStoreInventoryPlanCode,"0");
            //this.pivotGridControl出入库明细一览.DataSource = this.stockInOutDetailDTOs;
            //this.pivotGridControl出入库明细一览.RefreshData();
        }

        private void simpleButton确认_Click(object sender, EventArgs e)
        {
            Form扫工牌取工号 form = new Form扫工牌取工号();
            form.ShowDialog();
            if (!String.IsNullOrEmpty(form.mnemonic))
            {
                盘点Service.saveStockInventorySurplusIn(
                    this.stockStoreInventoryPlanCode,
                    form.mnemonic,
                    "",
                    this.stockInOutDetailDTOs
                    );
                MessageBox.Show("盘点入库成功");
            }
            else
            {
                MessageBox.Show("工牌错误");
            }
        }
    }
}
